home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / x / myAsciiSrcP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-04  |  4.9 KB  |  165 lines

  1. /* Borrowed by Jonny Goldman. */
  2. /*
  3. * $XConsortium: AsciiSrcP.h,v 1.8 91/02/20 17:58:15 converse Exp $
  4. */
  5.  
  6.  
  7. /***********************************************************
  8. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  9. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  10.  
  11.                         All Rights Reserved
  12.  
  13. Permission to use, copy, modify, and distribute this software and its 
  14. documentation for any purpose and without fee is hereby granted, 
  15. provided that the above copyright notice appear in all copies and that
  16. both that copyright notice and this permission notice appear in 
  17. supporting documentation, and that the names of Digital or MIT not be
  18. used in advertising or publicity pertaining to distribution of the
  19. software without specific, written prior permission.  
  20.  
  21. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  22. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  23. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  24. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  25. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  26. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  27. SOFTWARE.
  28.  
  29. ******************************************************************/
  30.  
  31. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  32.  
  33.  
  34. /*
  35.  * AsciiSrcP.h - Private Header for Ascii Text Source.
  36.  *
  37.  * This is the private header file for the Ascii Text Source.
  38.  * It is intended to be used with the Text widget, the simplest way to use
  39.  * this text source is to use the AsciiText Object.
  40.  *
  41.  * Date:    June 29, 1989
  42.  *
  43.  * By:      Chris D. Peterson
  44.  *          MIT X Consortium 
  45.  *          kit@expo.lcs.mit.edu
  46.  */
  47.  
  48. /* 
  49.  * TextSrcP.h - Private definitions for AsciiSrc object
  50.  * 
  51.  */
  52.  
  53. #ifndef _myAsciiSrcP_h
  54. #define _myAsciiSrcP_h
  55.  
  56. #ifdef sgi
  57. #include "myAsciiSrc.h"
  58. #include <X11/Xaw/TextSrcP.h>
  59. #else
  60. #include <X11/Xaw/TextSrcP.h>
  61. #include "myAsciiSrc.h"
  62. #endif
  63.  
  64. /************************************************************
  65.  *
  66.  * Private declarations.
  67.  *
  68.  ************************************************************/
  69.  
  70. #ifdef L_tmpnam
  71. #define TMPSIZ L_tmpnam
  72. #else
  73. #define TMPSIZ 32        /* bytes to allocate for tmpnam */
  74. #endif
  75.  
  76. #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
  77.  
  78. #define streq(a, b)        ( strcmp((a), (b)) == 0 )
  79.  
  80. typedef struct _Piece {        /* Piece of the text file of BUFSIZ allocated 
  81.                    characters. */
  82.   char * text;            /* The text in this buffer. */
  83.   XawTextPosition used;        /* The number of characters of this buffer 
  84.                    that have been used. */
  85.   struct _Piece *prev, *next;    /* linked list pointers. */
  86. } Piece;
  87.  
  88. /************************************************************
  89.  *
  90.  * New fields for the AsciiSrc object class record.
  91.  *
  92.  ************************************************************/
  93.  
  94. typedef struct _MyAsciiSrcClassPart { char foo; } MyAsciiSrcClassPart;
  95.  
  96. /* Full class record declaration */
  97. typedef struct _MyAsciiSrcClassRec {
  98.     ObjectClassPart     object_class;
  99.     TextSrcClassPart    text_src_class;
  100.     MyAsciiSrcClassPart    ascii_src_class;
  101. } MyAsciiSrcClassRec;
  102.  
  103. extern MyAsciiSrcClassRec myasciiSrcClassRec;
  104.  
  105. /* New fields for the AsciiSrc object record */
  106.  
  107. typedef struct _MyAsciiSrcPart {
  108.  
  109.   /* Resources. */
  110.  
  111.   char       *string;        /* either the string, or the
  112.                    file name, depending upon the type. */
  113.   XawAsciiType type;        /* either string or disk. */
  114.   XawTextPosition piece_size;    /* Size of text buffer for each piece. */
  115.   Boolean data_compression;    /* compress to minimum memory automatically
  116.                    on save? */
  117.   XtCallbackList callback;    /* A callback list to call when the source is
  118.                    changed. */
  119.   Boolean use_string_in_place;    /* Use the string passed in place. */
  120.   int     ascii_length;        /* length field for ascii string emulation. */
  121.  
  122. #ifdef ASCII_DISK
  123.   String filename;        /* name of file for Compatability. */
  124. #endif /* ASCII_DISK */
  125.  
  126. /* Private data. */
  127.  
  128.   Boolean    is_tempfile;      /* Is this a temporary file? */
  129.   Boolean       changes;      /* Has this file been edited? */
  130.   Boolean       allocated_string; /* Have I allocated the
  131.                      string in ascii_src->string? */
  132.   XawTextPosition length;     /* length of file */
  133.   Piece * first_piece;        /* first piece of the text. */
  134. } MyAsciiSrcPart;
  135.  
  136. /****************************************************************
  137.  *
  138.  * Full instance record declaration
  139.  *
  140.  ****************************************************************/
  141.  
  142. typedef struct _MyAsciiSrcRec {
  143.   ObjectPart    object;
  144.   TextSrcPart    text_src;
  145.   MyAsciiSrcPart    ascii_src;
  146. } MyAsciiSrcRec;
  147.  
  148. #endif /* _myAsciiSrcP_h  --- Don't add anything after this line. */
  149.  
  150. /*
  151.  * $Log: myAsciiSrcP.h,v $
  152.  * Revision 1.3  1994/08/05  07:25:43  pfeifer
  153.  * Release beta 04
  154.  *
  155.  * Revision 1.2  93/07/01  18:24:14  warnock
  156.  * Fixed problem on SGIs under X11R4
  157.  * 
  158.  * Revision 1.1  1993/02/16  15:10:18  freewais
  159.  * Initial revision
  160.  *
  161.  * Revision 1.1  92/06/22  10:43:39  jonathan
  162.  * Initial revision
  163.  * 
  164.  */
  165.